'use strict';

const Controller = require('egg').Controller;

class CultureController extends Controller {
  async index() {
    const { ctx } = this;
        ctx.body = "dish";
        var db = this.app.mongodb;
        var res = await db.collection("culture").find().toArray();
        if (res.length) {
            ctx.body = {
                status: 200,
                res
            }
        } else {
            ctx.status = 400;
            ctx.body = {
                status: 400,
                msg: "输入参数不合法"
            }
        }
  }
}

module.exports = CultureController;
